<?php

/**
 * Created by PhpStorm.
 * User: aako
 * Date: 15-12-22
 * Time: 下午3:20
 */

namespace App\Http\Requests\Front\collection;

use App\Http\Requests\Request;

class CollectionStoreRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        $rules =  [
            'type' => 'required|in:GOODS,SHOP',
            'reference_id' => 'required',
        ];
        return $rules;

    }

    /**
     * 验证信息
     * @return array
     */

    public function messages()
    {
        return [
            'type.required'  => '缺少收藏类型',
            'type.in'  => 'type类型错误',
            'reference_id.required'  => '缺少收藏id',
        ];
    }
}